import hotkeys from 'hotkeys-js'

function registeHotkeys(context) {
  hotkeys('ctrl+o, ctrl+q, ctrl+1, ctrl+2, ctrl+3, ctrl+4, ctrl+5', (ev, handler) => {
      ev.preventDefault()
      switch (handler.key) {
        case 'ctrl+o':
          context.setPanelStatus(true)
          break
        case 'ctrl+q':
          context.setPanelStatus(false)
          break
        case 'ctrl+1':
          context.setTheme(context.themes[0].value)
          break
        case 'ctrl+2':
          context.setTheme(context.themes[1].value)
          break
        case 'ctrl+3':
          context.setTheme(context.themes[2].value)
          break
        case 'ctrl+4':
          context.setTheme(context.themes[3].value)
          break
        case 'ctrl+5':
          context.setTheme(context.themes[4].value)
          break
      }
    })
}
window.hotkeys=hotkeys
export default registeHotkeys
